import { defineStore } from "pinia"
const userpermissionList = defineStore("permissionList", {
  state: () => {
    return {
      // 系统总账户
      adminList: [
        {
          loginId: "admin",
          password: "888888",
          roleId: 1,
          roleName: "超级管理员"
        },
        {
          loginId: "vip1",
          password: "888888",
          roleId: 2,
          roleName: "高级管理员"
        },
        {
          loginId: "vip2",
          password: "888888",
          roleId: 3,
          roleName: "中级管理员"
        }
      ],
      // 权限的总数据
      quanxianList: [
        {
          path: "/user",
          component: "User",
          title: "用户管理",
          role: [1],
          edit: {
            add: [1],
            update: [1],
            del: [1]
          }
        },
        {
          path: "/car",
          component: "Car",
          title: "汽车管理",
          role: [1, 2],
          edit: {
            add: [1, 2],
            update: [1, 2],
            del: [1]
          }
        },
        {
          path: "/phone",
          component: "Phone",
          title: "手机管理",
          role: [1, 2, 3],
          edit: {
            add: [1, 2, 3],
            update: [1, 2],
            del: [1]
          }
        }
      ],
      // 登陆账户
      cerrentAdmin: {},
      // 筛选出来的权限的数据
      screenQuanxianList: []
    }
  },
  actions: {
    setCerrentAdmin(e) {
      this.cerrentAdmin = e
    },
    updateScreenQuanxianList(e) {
      this.screenQuanxianList = e
    }
  }
})

export default userpermissionList
